package com.zz.slick;

import org.lwjgl.input.Mouse;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.GameState;
import org.newdawn.slick.state.StateBasedGame;

import com.zz.art.Art;

public class Menu extends BasicGameState implements GameState {

	public String mouse = "No input yet.";
	private int x;
	private int y;
	
	public Menu(int state) {

	}

	@Override
	public void mouseClicked(int arg0, int arg1, int arg2, int arg3) {

	}

	@Override
	public void mouseDragged(int arg0, int arg1, int arg2, int arg3) {

	}

	@Override
	public void mouseMoved(int arg0, int arg1, int arg2, int arg3) {

	}

	@Override
	public void mousePressed(int arg0, int arg1, int arg2) {
		
	}

	@Override
	public void mouseReleased(int arg0, int arg1, int arg2) {

	}

	@Override
	public void mouseWheelMoved(int arg0) {

	}

	@Override
	public void inputEnded() {

	}

	@Override
	public void inputStarted() {

	}

	@Override
	public boolean isAcceptingInput() {
		return false;
	}

	@Override
	public void setInput(Input arg0) {

	}

	@Override
	public void keyPressed(int arg0, char arg1) {

	}

	@Override
	public void keyReleased(int arg0, char arg1) {

	}

	@Override
	public void controllerButtonPressed(int arg0, int arg1) {

	}

	@Override
	public void controllerButtonReleased(int arg0, int arg1) {

	}

	@Override
	public void controllerDownPressed(int arg0) {

	}

	@Override
	public void controllerDownReleased(int arg0) {

	}

	@Override
	public void controllerLeftPressed(int arg0) {

	}

	@Override
	public void controllerLeftReleased(int arg0) {

	}

	@Override
	public void controllerRightPressed(int arg0) {

	}

	@Override
	public void controllerRightReleased(int arg0) {

	}

	@Override
	public void controllerUpPressed(int arg0) {

	}

	@Override
	public void controllerUpReleased(int arg0) {

	}

	@Override
	public void enter(GameContainer gc, StateBasedGame sbg) throws SlickException {

	}

	@Override
	public int getID() {
		return 0;
	}

	@Override
	public void init(GameContainer gc, StateBasedGame sbg) throws SlickException {
		
	}

	@Override
	public void leave(GameContainer arg0, StateBasedGame arg1) throws SlickException {

	}

	@Override
	public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException {
		/*g.drawString(mouse, 50, 50);
		g.fillRect(75, 100, 100, 100);
		g.drawString("play", 80, 130);*/
		//g.drawImage(Art.pic, xpos, ypos);
		g.drawImage(Art.startButton, 100, 100);
		g.drawImage(Art.exitButton, 100, 150);
		//g.drawRect(x, y, 30, 30);
	}

	@Override
	public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException {
		/*xpos = Mouse.getX();
		ypos = Mouse.getY();*/
		/*mouse = "Mouse position: " + xpos + ", " + ypos;
		input = gc.getInput();
		if(input.isKeyDown(Input.KEY_UP))
			ypos -= 1;
		if(input.isKeyDown(Input.KEY_DOWN))
			ypos += 1;
		if(input.isKeyDown(Input.KEY_LEFT))
			xpos -= 1;
		if(input.isKeyDown(Input.KEY_RIGHT))
			xpos += 1;*/
		x = Mouse.getX();
		y = Options.getResY() - Mouse.getY();
		
		if(x >= 100 && x <= 200 && y >= 100 && y <= 124){
			if(Mouse.isButtonDown(0))
				sbg.enterState(1);
		}
		if(x >= 100 && x <= 200 && y >= 150 && y <= 174) {
			if(Mouse.isButtonDown(0))
				System.exit(0);
		}
	
	}

}
